package com.lwq.lwqmicoservice.framework.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lwq.lwqmicoservice.common.model.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/6/10
 */
@Mapper
public interface PermissionMapper extends BaseMapper<SysPermission> {

    @Select("SELECT a.* FROM transit.sys_permission a INNER JOIN transit.rel_role_permission b ON a.id = b.permission_id WHERE b.role_id IN (${ids})")
    List<SysPermission> getPermissionByRoleIds(@Param(value = "ids") String ids);

}
